package com.jt.controller;

import com.jt.pojo.User;
import com.jt.pojo.User2;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/axios")
@CrossOrigin
public class AxiosController2 {
    @GetMapping("/findStr1")
    public String findStr(){
        return "开学了";
    }
    @GetMapping("/getUserById1")
    public String getUserById(Integer id ){
        return "获取数据"+id;
    }
    @GetMapping("/findUser1")
    public User2 findUser(User2 user2){
        return user2;
    }
    @GetMapping("/result1/{id}/{name}/{age}")
    public User2 result (User2 user2){
        return user2;
    }
    @PostMapping("/saveUser1")
    public User2 saveUser(@RequestBody User2 user2){
        return user2;
    }
}
